package com.bst.bsj.common.dal.ibatis;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.bst.bsj.common.dal.daointerface.SeedlingCompanyDAO;
import com.bst.bsj.common.dal.dataobject.SeedlingCompany;
import com.sylinxsoft.tools.dao.impl.CommonBaseDAOImpl;

@Service("seedlingCompanyDAO")
public class SeedlingCompanyDAOImpl extends CommonBaseDAOImpl implements SeedlingCompanyDAO {

  @Override
  public Long getCounts(Map paramMap) {
    return (Long) getSqlMapClientTemplate().queryForObject(getNameSpace() + ".MS_QUERY_COUNT", paramMap);
  }

 
  @Override
  public List<SeedlingCompany> selectAll(Map paramMap, Long offset, Long length) {
    paramMap.put("offset", offset);
    paramMap.put("length", length);
    return (List<SeedlingCompany>) this.getSqlMapClientTemplate().queryForList(getNameSpace() + ".MS_QUERY_PAGE",
        paramMap);
  }

  @Override
  public SeedlingCompany getSeedlingCompany(Long id) {
    return (SeedlingCompany) getSqlMapClientTemplate().queryForObject(getNameSpace() + ".MS_SELECT", id);
  }

  @Override
  public int update(SeedlingCompany seedlingCompany) {
    return getSqlMapClientTemplate().update(getNameSpace() + ".MS_UPDATE", seedlingCompany);
  }

  @Override
  public List<Map<String,Object>> queryAuthNum(Map<String,Object> paramsMap) {
    return (List<Map<String,Object>>) this.getSqlMapClientTemplate().queryForList(getNameSpace()// 
        + ".MS_AUTH_NUM",paramsMap);
  }


  @Override
  public SeedlingCompany getByParams(Map<String, Object> paramsMap) {
    return (SeedlingCompany) getSqlMapClientTemplate().queryForObject(getNameSpace() + ".MS_QUERY_OBJ", paramsMap);
  }


  @Override
  public void deleteByParams(Map<String, Object> paramsMap) {
    getSqlMapClientTemplate().delete(getNameSpace() + ".MS_DELETE", paramsMap);;
  }

}
